package com.uzai.console.service.feign.impl;

import com.uzai.common.msg.MsgDto;
import com.uzai.common.result.ResponseCode;
import com.uzai.console.common.UzaiRespVo;
import com.uzai.console.dto.remoteapi.CashierAuthpayContentDto;
import com.uzai.console.dto.rocketmq.pyqfollow.FollowConfigDto;
import com.uzai.console.service.feign.UzaiCashierAdminFeignService;
import com.uzai.console.service.feign.UzaiImClientFeignService;
import feign.hystrix.FallbackFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;

/**
 * @Auther: liuqi
 * @Date: 2021/11/24 16:24
 * @Description:
 */
@Component
public class UzaiCashierAdminFeignFallbackFactory implements FallbackFactory<UzaiCashierAdminFeignService> {

    private static Logger logger = LoggerFactory.getLogger(UzaiCashierAdminFeignFallbackFactory.class);

    @Override
    public UzaiCashierAdminFeignService create(Throwable throwable) {

        return new UzaiCashierAdminFeignService() {
            @Override
            public UzaiRespVo<String> getCachierAuthpayContent(CashierAuthpayContentDto cashierAuthpayContentDto) {
                UzaiRespVo<String> uzaiRespVo = new UzaiRespVo<>();
                uzaiRespVo.setData(null);
                uzaiRespVo.setCode(ResponseCode.ERROR);
                uzaiRespVo.setTime(System.currentTimeMillis());
                uzaiRespVo.setMsg("调用失败");
                return uzaiRespVo;
            }

            @Override
            public UzaiRespVo<String> alipayRechargesGetbody(CashierAuthpayContentDto cashierAuthpayContentDto) {
                UzaiRespVo<String> uzaiRespVo = new UzaiRespVo<>();
                uzaiRespVo.setData(null);
                uzaiRespVo.setCode(ResponseCode.ERROR);
                uzaiRespVo.setTime(System.currentTimeMillis());
                uzaiRespVo.setMsg("调用失败");
                return uzaiRespVo;
            }
        };
    }

}
